
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>荷尔萌APP下载</title>
  <meta name="keywords" content="荷尔萌APP下载" />
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" >
 　　<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>


 <style>
    body {margin: 0;}
	a {position: absolute;}
	div {position: absolute;}
	img {display: block; width: 100%; height: 100%}
	#app{margin: 0 auto;position: relative;max-width: 750px;}
	   #input {position: absolute;top: 0;left: 0;opacity: 0;z-index: -10;}

  </style>
  <script>
    window.nilhave = {
      docWidth: 750,
      data: [{"index":"1","left":0,"top":0,"width":750,"height":100,"outpath":"http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/1.png",  
	  "isLink":"yes","target":"_self","url":""},
	  
	  {"index":"2","left":0,"top":100,"width":750,"height":1120, "isLink":"yes","target":"_self","url":"http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/xcsp.mp4","outpath":"http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/2.jpg"},
	  
{"index":"3","left":0,"top":1220,"width":750,"height":160,"isLink":"yes","target":"_self","url":"","outpath":"http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/3.png"},
{"index":"4","left":0,"top":1380,"width":750,"height":122,"outpath":"http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/4.png"},
{"index":"5","left":0,"top":1502,"width":750,"height":1208,"isLink":"yes","target":"_self","url":"","outpath":"http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/5.png"}],
      matrix: '0x2'
    }
  </script>
  
  
  <script>
  
    var winWidth = window.innerWidth;
    var docWidth = window.nilhave.docWidth;
    var data = window.nilhave.data || '[]';
    winWidth = winWidth > 750 ? 750 : winWidth;
    var ratio = winWidth / docWidth;
    var docHtml = '';

    var matrix = window.nilhave.matrix.split('x');
var xp = parseInt(matrix[0]);
var yp = parseInt(matrix[1]);
var heightTotal = 0;

var leftArray = [];


data.forEach( function(imageItem, index) {
	let layerInfo = imageItem.layerInfo || imageItem;
	var width = layerInfo.width * ratio;
	var height = layerInfo.height * ratio;
	var top = layerInfo.top * ratio;
	var left = layerInfo.left * ratio;

	var _top = heightTotal;

	var leftToTal = 0;
	var _index = index - yp - 1;
	while(_index >= 0) {
		leftToTal += data[_index].width * ratio;
		_top += data[_index].top * ratio;

		_index -= (yp + 1);
	}
	

	//替换app 下载地址
	if(index!=1){
		imageItem.url = appurl();
	}
	
		docHtml += '<a style="width: ' 
			+ width +'px; height: ' 
			+ height + 'px ;top: ' 
			+ top + 'px ;left: ' 
			+ left + 'px ; '
			+ ' " href="' + (imageItem.isLink === 'yes' ? imageItem.url : "javascript:void(0)")  
			+ '" target="' 
			+ (imageItem.target || "_self") + '">';
			docHtml += '<img src="'+ imageItem.outpath + '" alt="' + imageItem.name + '" />';
	docHtml += '</a>';
	
 window.onload = function() {
      document.getElementById('app').innerHTML = docHtml;
    }
	if ((index + 1) % (yp + 1) === 0) {
		heightTotal = 0;
	} else {
		heightTotal += height;
	}


});

//判断
function appurl(){
	if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
		//alert(navigator.userAgent);  

	   return 'itms-services://?action=download-manifest&url=https://tzlc51.com/down/test.plist';
	} else if (/(Android)/i.test(navigator.userAgent)) {
		//alert(navigator.userAgent); 
		 return 'http://heermeng.oss-cn-hangzhou.aliyuncs.com/app/app-debug.apk?Expires=1545999902&OSSAccessKeyId=TMP.AQHLo6xaGoYcw5Xv80lsAIo_96Ilqae7FbQSiYnLNR6Bp5b2CsJuUHZXWAOsADAtAhUAy4aoLN4B504gnZNu5vcYQLsSx_ACFAIgOlzjin232-gSN6FzeLVme98v&Signature=n7yoN90Ih8pX9s2%2BTXDTy9u%2Fweo%3D';
	   
	} else {
		return 'http://www.baidu.com/';
	   
	};

}
   
</script>
 
</head>
<body>
  <div id="app"></div>
</body>
</html>